/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * LiftUI.java
 *
 * Created on Aug 15, 2011, 7:49:15 PM
 */
package elevatormanagementsystem.LiftUIForms;

import elevatormanagementsystem.Elevator;

/**
 *
 * @author Danny
 */
public class LiftUI extends javax.swing.JPanel {
    Elevator elevator;

    /** Creates new form LiftUI */
    public LiftUI(Elevator e) {
        initComponents();
        elevator = e;
    }

    public void start(){
        Thread t = new Thread();
        t.start();
    }    
    public void updateSelf() {
        currentFloorLbl.setText("" + elevator.getCurrentFloor());
        currentStatusLbl.setText("" + elevator.getMovingDirection());
        currentDoorsLbl.setText("" + elevator.getDoorStatus());
        repaint();
        if (elevator.getDoorStatus().equals("open")) {
            //change image to open
            repaint();
        }
        
    }
    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jLabel1 = new javax.swing.JLabel();
        jLabel2 = new javax.swing.JLabel();
        jLabel3 = new javax.swing.JLabel();
        currentFloorLbl = new javax.swing.JLabel();
        currentStatusLbl = new javax.swing.JLabel();
        currentDoorsLbl = new javax.swing.JLabel();

        jLabel1.setFont(new java.awt.Font("Tahoma", 1, 12)); // NOI18N
        jLabel1.setText("Currently on floor:");

        jLabel2.setFont(new java.awt.Font("Tahoma", 1, 12));
        jLabel2.setText("Doors:");

        jLabel3.setFont(new java.awt.Font("Tahoma", 1, 12));
        jLabel3.setText("Status:");

        currentFloorLbl.setText("jLabel4");

        currentStatusLbl.setText("jLabel5");

        currentDoorsLbl.setText("jLabel6");

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
        this.setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addGap(22, 22, 22)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                        .addComponent(jLabel2)
                        .addComponent(jLabel3))
                    .addComponent(jLabel1))
                .addGap(27, 27, 27)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(currentFloorLbl)
                    .addComponent(currentStatusLbl)
                    .addComponent(currentDoorsLbl))
                .addContainerGap(21, Short.MAX_VALUE))
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addGroup(layout.createSequentialGroup()
                        .addComponent(currentFloorLbl)
                        .addGap(34, 34, 34)
                        .addComponent(currentStatusLbl)
                        .addGap(26, 26, 26)
                        .addComponent(currentDoorsLbl))
                    .addGroup(layout.createSequentialGroup()
                        .addComponent(jLabel1)
                        .addGap(34, 34, 34)
                        .addComponent(jLabel3)
                        .addGap(26, 26, 26)
                        .addComponent(jLabel2)))
                .addContainerGap(111, Short.MAX_VALUE))
        );
    }// </editor-fold>//GEN-END:initComponents
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JLabel currentDoorsLbl;
    private javax.swing.JLabel currentFloorLbl;
    private javax.swing.JLabel currentStatusLbl;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel jLabel3;
    // End of variables declaration//GEN-END:variables

    public void Show() {
        throw new UnsupportedOperationException("Not yet implemented");
    }
}
